package org.example.mallcommon.confing;

import org.example.mallcommon.interceptor.LoginInterception;
import org.example.mallcommon.tool.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 韩先楚
 * 拦截器配置
 */
@Configuration
public class LoginConfig implements WebMvcConfigurer {

    @Autowired
    private JwtUtil jwtUtil;

    @Autowired
    private StringRedisTemplate stringRedisTemplate;
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new LoginInterception(jwtUtil, stringRedisTemplate))
//                .addPathPatterns("/**")
//                .excludePathPatterns("/api/login", "/api/register", "/api/logout");
//    }
}
